<script type="text/javascript">
    $(document).ready(function(){
        $(".img-product-thumb").click(function () { 
            src = $(this).attr("src");
            $("#active_photo").attr("src",src);
        });
    });
</script>
<script type="text/javascript" data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script>
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=151390271591966";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div id="content">
    <div id="left-box">
        
    </div>
    <div id="products-container">
        <div id="product-breadcumb">
            <h1 id="product-name">
                <?php echo $product->name;?>
            </h1>
        </div>
        <div id="product-container">
            <div id="product-slider">
                <table id="product-slider-table">
                    <tr>
                        <td>
                            <div id="product-photo">
                                <div id="product-photo-active">
                                    <?php if($product->photo->num_rows() > 0):?>
                                    <img data-pin-hover="true" id="active_photo" src="<?php echo base_url();?>photo/products/<?php echo $product->photo->first_row()->link;?>"/>
                                    <?php endif;?>
                                </div>
                            </div>
                        </td>
                        <td>
                            <div id="product-photo-list">
                                <?php foreach($product->photo->result() as $p):?>
                                <div class="product-photo-thumb">
                                    <img class="img-product-thumb" src="<?php echo base_url();?>photo/products/<?php echo $p->link;?>" />
                                </div>
                                <?php endforeach;?>
                            </div>
                        </td>
                    </tr>
                </table>                
            </div>
            <table id="product-info">
                <tr>
                    <td>
                        <div id="product-desc">
                            <p>
                                <?php echo $product->description;?>
                            </p>
                        </div>
                    </td>
                    <td>
                        <div id="product-add-to-cart">
                            <span>QTY </span>
                            <input type="text" id="product-qty-input" name="qty" maxlength="2" value="01"/>
                            <input type="hidden" id="product-id-input" name="id" value="<?php echo $product->id;?>" type="hidden"/>
                            <img title="Add this product to your cart" id="img-add-to-cart" src="<?php echo base_url();?>images/add-to-cart.png"/>
                        </div>
                        <div class="_blank" style="height: 10px;"></div>
                        <?php if($product->qty_status>0):?>
                        <div id="product-qty-status">
                            <?php if($product->qty_status==1):?>
                            <img src="<?php echo base_url();?>images/in_stock.png" alt="In Stock" />
                            <?php elseif($product->qty_status==2):?>
                            <img src="<?php echo base_url();?>images/low_stock.png" alt="Low Stock" />
                            <?php elseif($product->qty_status==3):?>
                            <img src="<?php echo base_url();?>images/sold_out.png" alt="SOld Out" />
                            <?php endif;?>
                        </div>
                        <?php endif;?>
                        <div id="product-price">
                            <h3>
                                Rp. <?php echo number_format($product->price, 0, '', ' ');?>
                            </h3>
                        </div>
                        <div id="product-detail">
                            <table>
                                <tr>
                                    <td class="dd-left">Designer</td>
                                    <td class="dd-middle">:</td>
                                    <td>
                                        <a href="<?php echo base_url(); ?>designers/view/<?php echo $product->designer_id; ?>">
                                            <?php echo $product->full_name; ?>
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="dd-left">Dimension</td>
                                    <td> : </td>
                                    <td><?php echo $product->dimention;?></td>
                                </tr>
                                <tr>
                                    <td class="dd-left">Materials</td>
                                    <td> : </td>
                                    <td><?php echo $product->materials;?></td>
                                </tr>
                                <tr>
                                    <td class="dd-left">Year</td>
                                    <td> : </td>
                                    <td><?php echo $product->year;?></td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
            <div class="_blank" style="height: 50px;"></div>
            <div id="social-links-wrap">
                <div id="social-twitter">
                    <a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
                    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
                </div>
                <div class="fb-like" data-send="false" data-layout="button_count" data-width="450" data-show-faces="true" data-font="arial"></div>
            </div>
        </div>
        <div class="clear"></div>
        <div class="_blank" style="height: 20px;"></div>
    </div>
    <div class="clear"></div>
    <?php $this->load->view('footer_v');?>
</div>